package fitness;

import org.jgap.FitnessFunction;
import org.jgap.IChromosome;

import character.Priest;
import character.Warrior;

public class PriestFitness extends FitnessFunction {

	@Override
	protected double evaluate(IChromosome profile) {
		Integer strength = (Integer) profile.getGene(0).getAllele();
		Integer agility =  (Integer) profile.getGene(1).getAllele();
		Integer stamina =  (Integer) profile.getGene(2).getAllele();
		Integer intellect =  (Integer) profile.getGene(3).getAllele();
		Integer spirit =  (Integer) profile.getGene(4).getAllele();
		
		Priest priest = new Priest();
		priest.setStrength(strength);
		priest.setAgility(agility);
		priest.setStamina(stamina);
		priest.setIntellect(intellect);
		priest.setSpirit(spirit);
		
		double res = 1.160 * priest.getAttackPower() +
					 2.320  * priest.getArmor() + 
					 4.640  * priest.getSpeed() +
					 0.000  * priest.getResilience() + 
					 0.000  * priest.getDodgeRating() + 
					 2.784 * priest.getMana() +
					 0.928 * priest.getHealth() +
					 32.483  * priest.getSpellPenetration() +
					 23.202  * priest.getHaste() + 
					 4.640  * priest.getHealthRegeneration() +
					 27.843  * priest.getManaRegeneration();
		return res;
	}
	
}
